package sdu.icat.pj.sys.web;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import sdu.icat.pj.base.ResponseMap;
import sdu.icat.pj.listener.SessionListener;

/**
 * 用户会话管理
 * @author ljh_2015
 *
 */
@RestController
@Api(value="session manager",tags={"session manager"})
@RequestMapping(value="/session")
public class SysSessionController {

    @Autowired SessionListener sessionListener;
    
    @ApiOperation(value="查询会话数量")
    public ResponseMap get(@RequestBody Map<String,Object> param) {
	ResponseMap map = new ResponseMap();
	Integer number = sessionListener.getAllUserNumber();
	map.setAttribute("userNumber", number);
	return map;
    }
    
}
